import 'package:flutter/material.dart';
import 'package:flutter/material.dart';
import 'package:demo190801_helloworld/demo2_basicWidget/MyScaffold.dart';
import 'package:demo190801_helloworld/demo3_material_app/TutorialHome.dart';
import 'package:demo190801_helloworld/demo4_gesture/MyButton.dart';
import 'package:demo190801_helloworld/demo5_user_change_widget/Counter.dart';
import 'package:demo190801_helloworld/demo6_couter_display/CounterDisplay.dart';
import 'package:demo190801_helloworld/demo7_collect/ShoppingList.dart';


// 一个最简单的Flutter应用程序，只需一个widget即可！
void main1() {
  //该runApp函数接受给定的Widget并使其成为widget树的根
  runApp(
      new Center(
        child: new Text(
          'hello world',
          textDirection: TextDirection.ltr,
        ),
      )
  );
}

void main() {
  runApp(new MaterialApp(
    title: 'My App',
// 这里是demo2 - 基础的布局
//    home: new MyScaffold(),
  // 这里是demo3 - 使用material组件
//    home: new TutorialHome(),
  // 这里是demo4 - 按钮
//    home: new MyButton()
  // 这里是demo5 - 累加
//    home: new Counter(),
  // 这里是demo6 - 累加 - 优化
//    home: new Counter2(),
  // 这里是demo7 - 总结，生成一个购物车
    home: new ShoppingList(
        products: <Product>[
          new Product(name: '鸡蛋'),
          new Product(name: '面包'),
          new Product(name: '火腿'),
          new Product(name: '方便面'),
          new Product(name: '雪糕'),
          new Product(name: '奥利奥'),
        ],
    )
  ));
}

